<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>获取验证码</title>
</head>
<style>
    input{
        width: 125px;
        height: 60px;
        border: none;
        margin-left: 50%;
        margin-top: 20%;
        font-size: 20px;
        background-color: #4cae4c;
        color: white;
        font-family:"微软雅黑";
        cursor: pointer;
    }
</style>
<body>
<input type="button" value="获取验证码" id="getCode" onclick="settime(this)">
<script src="jquery-2.1.1.js"></script>
</body>
<script>
    var count=60;
    var getCode=$("#getCode");
    function settime(obj) {
        getCode.attr("disabled",true);
        if (count==0) {
            getCode.attr("value","获取验证码");
            getCode.attr("disabled",false)

        }else{
            obj.value="重新发送(" + count + ")";
            count--;
        }
        var aa=setInterval(function() {
                    clearInterval(aa);
                    settime(obj)},1000);
    }
</script>
</html>